package com.wyf.order.feign;

import com.wyf.order.config.FeignConfig;
import feign.RequestLine;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * name: 指定调用rest接口所对应的服务名
 * path: 指定调用rest所在的StockController指定的@RequestMapping
 */
@FeignClient(name = "stock-service", path = "/stock", configuration = FeignConfig.class)
public interface StockFeignService {

    // 声明需要调用的rest接口对应的方法
    @RequestMapping("/reduck")
    public String reduct();
    // @RequestLine("GET /reduck")
    // public String reduct();

    // @RestController
    // @RequestMapping("/stock")
    // public class StockController {
    //
    //     @Value("${server.port}")
    //     String port;
    //
    //     @RequestMapping("reduck")
    //     public String reduct() {
    //         System.out.println("扣减库存");
    //         return "扣减库存" + " " + port;
    //     }
    // }

}
